const Mongoose = require('mongoose')
// http://106.12.132.55:27017/
const conn = Mongoose.createConnection("mongodb://106.12.132.55:27017/liuting", {
  useNewUrlParser:true,
  useUnifiedTopology: true
})

conn.on('open',  console.log.bind(console, '连接成功！！'))
conn.on('error',  console.log.bind(console, '连接失败！！'))

let Schema = new Mongoose.Schema({
  list: Number | String,
  createAt: {
    type: Date,
    default: Date.now
  }
},)

let Product = conn.model('liutings', Schema)

Product.create({list: '这是新创建的' }).then(res => {
  console.log(res)
})
Product.find().then(res => {
  console.log('result', res)
})